
<?php

/**
 * Created by PhpStorm.
 * User: huynguyen
 * Date: 3/20/14
 * Time: 6:05 PM
 */

    $products = Yii::app()->getBestSeller();
     if(!empty($products)){
         // draw outside div
         echo CHtml::openTag("div",  array("class"=> "box"));
         echo CHtml::openTag("div",  array("class"=>  "box-heading"));
         echo CHtml::openTag("span");
         echo Yii::t("messages", "Bestsellers") ;
         echo CHtml::closeTag("span"). "\n";
         echo CHtml::closeTag("div"). "\n";
         echo CHtml::openTag("div",  array("class"=>  "box-content"));
         echo CHtml::openTag("div",  array("class"=>  "box-product"));
         echo CHtml::openTag("div",  array("class"=>  "flexslider"));
         echo CHtml::openTag("ul",  array("class"=>  "slides"));
         // draw items
         foreach($products as $product){
             echo CHtml::openTag("li");
             echo CHtml::openTag("div", array("class"=>"slide-inner"));
             echo CHtml::openTag("div", array("class"=>"image"));
             echo CHtml::Link("<img src='".Yii::app()->request->baseUrl."/assets/theme_a/image/product/sony_vaio_1-45x45.jpg' alt=\"Friendly Jewelry\" />", array("product/index", "catSlug" => $product->Menu->MENU_SLUG, "prodSlug" => $product->SLUG));
             echo CHtml::closeTag("div"). "\n";
             echo CHtml::openTag("div", array("class"=>"name"));
             echo  CHtml::link($product->PRODUCT_NAME);
             echo CHtml::closeTag("div"). "\n";
             echo CHtml::openTag("div", array("class"=>"clear"));
             echo CHtml::closeTag("div"). "\n";
             echo CHtml::closeTag("div"). "\n";
             echo CHtml::closeTag("li"). "\n";
         }
         //end draw items
         echo CHtml::closeTag("ul"). "\n";
         echo CHtml::closeTag("div"). "\n";
         echo CHtml::closeTag("div"). "\n";
         echo CHtml::closeTag("div"). "\n";
         echo CHtml::closeTag("div"). "\n";
         //end draw outsite div
     }

  ?>